package com.java.control.search;

import org.apache.commons.lang.StringUtils;

/**
 * 系统编码
 * @author wqf
 * @version  Nov 24, 2011 11:55:45 AM
 */
public class CodeSearchCond extends SearchCond{
	
	private String codeType;
	private String codeName;

	public ConditionPart getCondition(){
		ConditionPart cp=new ConditionPart();
		StringBuffer searchStr=new StringBuffer(" 1=1");
		
		if(StringUtils.isNotBlank(codeType)){
			searchStr.append(" and codeType like ?");
			cp.getParams().add("%"+codeType.trim()+"%");
		}
		if(StringUtils.isNotBlank(codeName)){
			searchStr.append(" and codeName like ?");
			cp.getParams().add("%"+codeName.trim()+"%");
		}
		cp.setExpression(searchStr.toString());
		return cp;
	}


	public String getCodeName() {
		return codeName;
	}


	public void setCodeName(String codeName) {
		this.codeName = codeName;
	}


	public String getCodeType() {
		return codeType;
	}


	public void setCodeType(String codeType) {
		this.codeType = codeType;
	}


}
